package com.ushine.design.design.c_behavioral_pattern.c_interpreter.a_practice;

import java.util.HashMap;
import java.util.Map;

/**
 * 环境类
 *
 * @author yls
 */
public class Context {
    private Map<String, String> map = new HashMap<>();

    public void assign(String key, String value) {
        //往环境类中添加值
        map.put(key, value);
    }

    public String lookup(String key) {
        //获取环境类中的值
        return map.get(key);
    }

}
